<?
echo '<pre><h1>unpacked code:</h1><br />';
 echo "\nMD5 data: ". md5(file_get_contents("rename.php"));
mysql_connect('localhost', 'root', 'Tiberian');
 mysql_select_db('opanel');
 
echo '<br /><h1>re-packed code:</h1><br />';

$sql = 'SELECT * FROM `update` WHERE CONVERT( `update` . `file` USING utf8 ) = \'rename.php\' ';
$res = mysql_query($sql);
$new = mysql_fetch_row($res);
$file = "C:/xampp/xampp/htdocs/oPanel/update/rename.php";

echo "\n\n\n\n\n<br /><br /><br />";
print_r($new);
echo '</pre>';
$fp = @fopen("$file","w+");
$content = pack("a" . strlen($new['1']), $new['1']);
fwrite($fp, $content);
fclose($fp);
echo "<br />MD5 file: ".md5(file_get_contents("rename.php"))."<br />\n\n";
if(md5(file_get_contents("rename.php")) != $new['2']) { echo 'file missmatch'; } else { echo 'Update sucessfull'; }
?>